﻿/* Copyright 2010 Igor Francé
 * 
 * This file is part of ECMADoc (http://ecmadoc.codeplex.com).
 * 
 * ECMADoc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License 
 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 * 
 * ECMADoc is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with ECMADoc. 
 * If not, see http://www.gnu.org/licenses/.
 */
namespace EcmaDoc.Core
{
	using System;
	using System.Collections.Generic;

	public static class Constants
	{
		public static IDictionary<string, string> NamePluralizationDictionary = 
			new Dictionary<string, string>
			{
				{ "namespace", "namespaces" },
				{ "class", "classes" },
				{ "function", "functions" },
				{ "property", "properties" },
				{ "document", "documents" },
				{ "method", "methods" },
				{ "object", "objects" },
				{ "project", "projects" },
				{ "event", "events" },
				{ "enumeration", "enumerations" },
				{ "value", "values" },
				{ "variable", "variables" },
			};

		public static List<ItemType> ExportOrder =
			new List<ItemType>()
			{
				ItemType.Project,
				ItemType.Namespace,
				ItemType.Class,
				ItemType.Function,
				ItemType.Object,
				ItemType.Enumeration,
				ItemType.Event,
			};
	}

	public enum GroupMembersBy
	{
		None,
		Type,
	}

	public enum LogFormat
	{
		Text,
		Html,
	}

	public enum LogCategory
	{
		Debug = 1,
		Info = 2,
		Warning = 3,
		Error = 4,
		Fatal = 5,
	}

	/// <summary>
	/// Defines the possible comments types.
	/// </summary>
	public enum CommentType
	{
		/// <summary>
		/// Signifies a comment that documents a file.
		/// </summary>
		File,
		
		/// <summary>
		/// Signifies a comment that documents a code container (function, object, class...).
		/// </summary>
		Context,
		
		/// <summary>
		/// Signifies a comment that documents a code variable.
		/// </summary>
		Item,
	}

	/// <summary>
	/// Defines the member visibility.
	/// </summary>
	public enum Visibility
	{
		/// <summary>
		/// Default value, indicates that no visibility has been set.
		/// </summary>
		Default = 0,

		/// <summary>
		/// Signifies a private member
		/// </summary>
		Private = 1,

		/// <summary>
		/// Signifies a public member added to a function's prototype.
		/// </summary>
		Prototype = 2,

		/// <summary>
		/// Signifies a public member
		/// </summary>
		Public = 3,

		/// <summary>
		/// Signifies a public member added to an object instamce.
		/// </summary>
		Instance = 4,

		/// <summary>
		/// Signifies a static member
		/// </summary>
		Static = 5,
	}

	/// <summary>
	/// Defines the type of code item.
	/// </summary>
	[Flags]
	public enum ItemType
	{
		/// <summary>
		/// Signifies an object item
		/// </summary>
		Object = 1,

		/// <summary>
		/// Signifies an event item
		/// </summary>
		Event = 2,

		/// <summary>
		/// Signifies a function item
		/// </summary>
		Function = 4,

		/// <summary>
		/// Signifies a class item
		/// </summary>
		Class = 8,

		/// <summary>
		/// Signifies an enum item
		/// </summary>
		Enumeration = 16,

		/// <summary>
		/// Signifies a document item
		/// </summary>
		Document = 128,

		/// <summary>
		/// Signifies a namespace item
		/// </summary>
		Namespace = 256,

		/// <summary>
		/// Signifies a project item
		/// </summary>
		Project = 512,
	}

	[Flags]
	public enum MatchFlags
	{
		None = 0,
		Private = 1,
		Literal = 2,
		Prototype = 4,
		PropertyAssignment = 8,
	}

	/// <summary>
	/// Represents different parser modes.
	/// </summary>
	public enum ParseMode
	{
		/// <summary>
		/// Parsing that occurs outside of any function or object item.
		/// </summary>
		Global = 1,

		/// <summary>
		/// Parsing that occurs within functions.
		/// </summary>
		Function = 2,

		/// <summary>
		/// Parsing that occurs within constructors.
		/// </summary>
		Constructor = 3,

		/// <summary>
		/// Parsing that occurs within JavaScript objects specified using literal notation.
		/// </summary>
		Literal = 4,
	}

	[Flags]
	public enum HtmlPageType
	{
		None = 0,
		Object = 1,
		Namespace = 2,
		Document = 4,
		Project = 8,
		Index = 64,
		Contents = 128,
		Default = 256,
		All = 511,
	}
}